From 07a27576b14c716c398a1fd37d2816694e04f398 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 18 Feb 2006 01:01:52 +0100 Subject: [PATCH] Svm patch to fix asid logic on multicore. Signed-off-by: Tom Woller --- xen/arch/x86/hvm/svm/svm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 44b6b78e73..d02002d334 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -2666,18 +2666,22 @@ asmlinkage void svm_asid(void) struct vcpu *v = current; struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; int core = smp_processor_id(); + int oldcore = v->arch.hvm_svm.core; /* * if need to assign new asid or if switching cores, * then retire asid for old core, and assign new for new core. */ - if( svm_dbg_on) - printk("old core %d new core %d\n",(int)v->arch.hvm_svm.core,(int)core); - + if( v->arch.hvm_svm.core != core ) { + if (svm_dbg_on) + printk("old core %d new core %d\n",(int)v->arch.hvm_svm.core,(int)core); + v->arch.hvm_svm.core = core; + } if( test_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags) || - (v->arch.hvm_svm.core != core)) { + (oldcore != core)) { if(!asidpool_assign_next(vmcb, 1, - v->arch.hvm_svm.core, core)) { - BUG(); + oldcore, core)) { + /* If we get here, we have a major problem */ + domain_crash_synchronous(); } } clear_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags); -- 2.30.2